<template>
  <div class="highsearch">
    <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
      <!-- 1 -->
      <el-row>
        <!-- 编号 -->
        <el-col :span="8">
          <el-form-item label="编号">
            <el-input v-model="form.number"></el-input>
          </el-form-item>
        </el-col>
        <!-- 客户名称 -->
        <el-col :span="8">
          <el-form-item label="客户名称">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
        </el-col>
        <!-- 收入支出 -->
        <el-col :span="8">
          <el-form-item label="收入支出">
          <el-cascader :options="form.options" clearable></el-cascader>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 2 -->
      <el-row>
        <!-- 收支日期 -->
        <el-col :span="8">
          <el-form-item label="收支日期">
            <el-col :span="11">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="form.date1"
                style="width: 100%"
              ></el-date-picker>
            </el-col>
            <el-col class="line" :span="2">-</el-col>
            <el-col :span="11">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="form.date2"
                style="width: 100%"
              ></el-date-picker>
            </el-col>
          </el-form-item>
        </el-col>
        <!-- 备注 -->
        <el-col :span="8">
          <el-form-item label="备注">
            <el-input v-model="form.note"></el-input>
          </el-form-item>
        </el-col>
        <!-- 客户来源 -->
        <el-col :span="8">
          <el-form-item label="客户来源">
            <el-select v-model="form.value1" placeholder="请选择">
              <el-option
                v-for="item in source"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 3 -->
      <el-row>
        <!-- 经办人 -->
        <el-col :span="8">
          <el-form-item label="经办人">
            <el-select v-model="form.value2" placeholder="请选择">
              <el-option
                v-for="item in handler"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 资金账户 -->
        <el-col :span="8">
          <el-form-item label="资金账户" :span="8">
            <el-select v-model="form.value3" placeholder="请选择">
              <el-option
                v-for="item in account"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 是否审核 -->
        <el-col :span="8">
          <el-form-item label="是否审核" :span="8">
            <el-select v-model="form.value4" placeholder="请选择">
              <el-option
                v-for="item in form.examine"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 4 -->
      <!-- 自定义字段搜索 -->
      <el-row>
        <el-col :span="8">
          <el-form-item label="自定义搜索">
            <el-input v-model="form.searching"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 底部按钮 -->
      <el-row :class="btn">
        <el-col>
          <el-button type="primary" @click="submitForm" plain
            >立即搜索</el-button
          >
          <el-button type="warning" @click="resetForm" plain
            >清空条件</el-button
          >
          <el-button type="info" @click="exportForm" plain>导出数据</el-button>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>

export default {
  name: "HighSearch",
  data() {
    return {
      form: {
        number: "", //编号
        name: "", //客户名称
        date1: "", //日期1
        date2: "", //日期2
        note: "", //备注
        value1: "", // 客户来源
        value2: "", //经办人
        value3: "", //资金账户
        value4: "", //是否审核
        searching: "", //自定义搜索
        // 收入支出
        options: [{
          value: 'select',
          label: '请选择',
        },{
          value: 'outcome',
          label: '支出',
          children: [{
            value: 'selected',
            label: '请选择'
          }, {
            value: 'traffic',
            label: '交通费'
          },{
            value: 'communication',
            label: '通讯费'
          },{
            value: 'eat',
            label: '餐饮住宿'
          },{
            value: 'gifts',
            label: '赠送礼品'
          },{
            value: 'order',
            label: '采购'
          },{
            value: 'other',
            label: '其他'
          }]
        },{
          value: 'income',
          label: '收入',
          children: [{
            value: 'selected',
            label: '请选择'
          },{
            value: 'preorder',
            label: '订单预付款'
          }, {
            value: 'precontract',
            label: '合同款'
          }, {
            value: 'fix',
            label: '维修费'
          },{
            value: 'product',
            label: '产品续费'
          },{
            value: 'other',
            label: '其他'
          }]
        }],
        // 是否审核
        "examine": [
          {
            value: "checked",
            label: "已审核"
          },
          {
            value: "check",
            label: "未审核"
          },
        ]
      },
      btn: "btn",
      content: "content",
    };
  },
  props: [
    "source", //客户来源
    "handler", // 经办人
    "account",  // 资金账户
  ],
  methods: {
    submitForm() {}, //搜索
    resetForm() {}, //重置
    exportForm() {}, //导出
  },
};
</script>

<style>
.content {
  margin: 20px 0px;
}
.btn {
  text-align: center;
}
.demo-ruleForm {
  margin-top: 20px;
}
</style>